/**
 * Copyright (c) 2015-2030 by Beijing Yanlight Co., Ltd.
 * All rights reserved.
 */
package com.yanlight.support.alipay;

import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;

/**
 * 
 * @author haolw
 * @time 2017/07/21
 */
public abstract class AlipayFactory {
	public static final String FORMAT = "json";
	public static final String SIGNTYPE = "RSA2";
	public static final String CHARSET = "UTF-8";

	public static AlipayClient providerClient() {
		return client(AlipayConstants.appId, AlipayConstants.privateKey, AlipayConstants.publicKey);
	}

	public static AlipayClient client(String appId, String privateKey, String publicKey) {
		String gateway = AlipayConstants.gateway;
		return new DefaultAlipayClient(gateway, appId, privateKey, FORMAT, CHARSET, publicKey, SIGNTYPE);
	}

}
